{% extends 'new_hire_base.html' %}
{% load i18n %}
{% load humanize %}

{% block actions %}{% endblock %}

{% block content %}
<div class="row justify-content-md-center">
  <div class="col-md-8 col-12">
    {% if not overdue_to_do_items|length and not to_do_items|length %}
    <div class="card">
      <div class="card-body" style="position: relative;">
        {% trans "You have completed all to do items" %}
      </div>
    </div>
    {% endif %}
    {% if overdue_to_do_items %}
    <div class="card">
      <div class="card-body" style="position: relative;">
        <h3 class="card-title" style="color: red">{% translate "Overdue" %}</h3>
        <table class="table table-vcenter">
          <tbody>
            {% for to_do in overdue_to_do_items %}
              {% include "_new_hire_to_do_item.html" %}
            {% endfor %}
          </tbody>
        </table>
      </div>
    </div>
    {% endif %}
    {% if to_do_items %}
    <div class="card">
      <div class="card-body" style="position: relative;">
        {% for obj in to_do_items %}
        <h3 class="card-title">{% if obj.date is not None %}{% translate "Due on " %}{{ obj.date|naturalday }}{% else %}{% trans "Not urgent" %}{% endif %}</h3>
          <table class="table table-vcenter">
            <tbody>
              {% for to_do in obj.items %}
                {% include "_new_hire_to_do_item.html" %}
              {% endfor %}
            </tbody>
          </table>
        {% endfor %}
      </div>
    </div>
    {% endif %}
  </div>
</div>
{% endblock %}
